#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#define N 10

int find(int a[], int n, int x)
{
	int fi = 0;
	for (fi = 0; fi < n; fi++)
	{
		if (a[fi] == x)
			return fi;
	}
	return -1;
}

void del(int a[], int n, int i)
{
	int di = 0;
	for (di = i; di < n; di++)
	{
		a[di] = a[di + 1];
	}
	a[di] = ' \0';
}

void PrintArr(int a[], int n)
{
	int pi = 0;
	for (pi = 0; pi < n - 1; pi++)
	{
		printf("%4d", a[pi]);
	}
}

int main()
{
	int arr[N];
	int m = 0;
	scanf("%d", &m);

	int i = 0;
	for (i = 0; i < m; i++)
	{
		scanf("%d", &arr[i]);
	}

	int y = 0;
	scanf("%d", &y);

	int ret = find(arr, m, y);

	if (ret == -1)
	{
		printf("Not Found");
	}
	else
	{
		del(arr, m, ret);
		PrintArr(arr, m);
	}
	return 0;
}